<template>
	<view class="partner-join-state e-p-20" :style="[AppSkinVar]">
		<view class="partner-join-state__steps bg-white  e-m-b-20 e-flex-y-center ">
			<view class="e-flex-1">
				<steps :value="4" />
			</view>
		</view>
		<view class="partner-join-state__box bg-white ">
			<view class="e-flex-xy-center">
				<image src="../static/success.png" class="partner-join-state__icon" v-if="type === 'success'"></image>
				<image src="../static/error.png" class="partner-join-state__icon" v-else></image>
			</view>
			<view class="e-font-32 text-center e-m-b-20">
				<text>{{ $t(`store.${type === 'success' ? 'joinStpe1' : 'joinStpe2'}`) }}</text>
			</view>
			<view class="e-font-32 text-center" v-if="info.state === 3 && info.rejectRemark">
				{{$t('tools.拒绝原因')}}{{$t('common.:')}}{{info.rejectRemark}}
			</view>
			<view class="e-flex-xy-center">
				<view class="partner-join-state__btn e-flex-xy-center bg-primary e-font-32 c-white" @tap="$back(1)"
					v-if="type === 'success'">
					<text>{{$t('common.返回')}}</text>
				</view>
				<view class="partner-join-state__btn e-flex-xy-center bg-primary e-font-32 c-white"
					@tap="$goTo('/pages/store/join/type')" v-if="type === 'error'">
					<text>{{$t('store.cxtj')}}</text>
				</view>

			</view>
		</view>


	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	import steps from './child/steps.vue'
	import {
		getUserRegisterStoreState
	} from '@/common/request/api'
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import type {PickPromise} from '@/typings/utils'
	
	const props = defineProps({
		type:String
	})
	

	const info = ref<PickPromise<ReturnType<typeof getUserRegisterStoreState>>['data']>({
		state:0,
		rejectRemark:""
	})
	
	onLoad(() => {
		getUserRegisterStoreState().then(res => {
			info.value = res.data
		})
	})

</script>

<style lang="scss" scoped>
	.partner-join-state {
		&__steps {
			height: 160rpx;
			border-radius: 10rpx;
		}

		&__box {
			padding: 94rpx 0;
			border-radius: 10rpx;
			height: calc(100vh - 220rpx);
		}

		&__icon {
			width: 120rpx;
			height: 120rpx;
			margin-bottom: 52rpx;
		}

		&__btn {
			margin-top: 54rpx;
			width: 278rpx;
			height: 90rpx;
			border-radius: 46rpx;
		}
	}
</style>